SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 51083: Decimal numbers might be generated as large exponent numbers with the XLSX driver

DetailsAboutRate It
When you use the XLSX driver to export data to Microsoft XLSX files, decimal numbers might be generated as large exponent numbers. The following example shows the error:
data temp1; input mynumber; datalines; 99.9 99.99 99.999 99.9999 99.99999 99.999999 99.9999999 99.99999999 99.999999999 99.9999999999 99.99999999991 99.999999999991 99.99999999999 99.999999999999 999.9 999.99 999.999 999.9999 999.99999 999.999999 999.9999999 999.99999999 999.999999999 999.9999999999 999.99999999991 999.999999999991 999.99999999999 999.999999999999 9999.9 9999.99 9999.999 9999.9999 9999.99999 9999.999999 9999.9999999 9999.99999999 9999.999999999 9999.9999999999 9999.99999999991 9999.999999999991 9999.99999999999 9999.999999999999 ; proc export data=temp1 outfile='c:\sastest\mydecimals.xlsx' dbms=xlsx replace; sheet='mysheet'; run;
The resulting Excel file has the following numbers in it. There are also several numbers without a decimal point that are incorrect.
mynumber 99.9 99.99 99.999 99.9999 99.99999 99.999999 99.9999999 99.99999999 100 100 100 1E+19 1E+15 1E+19 999.9 999.99 999.999 999.9999 999.99999 999.999999 999.9999999 1000 1000 1E+16 1E+20 1E+20 1E+20 1E+20 9999.9 9999.99 9999.999 9999.9999 9999.99999 9999.999999 10000 10000 1E+17 1E+21 1E+21 1E+20 1E+21 10000

The problem occurs because the driver does not place a decimal point when the data precision is very close to a whole number with the power of 10, such as 100, 1000, 10000. To circumvent the problem, use the DBMS=EXCEL or DBMS=EXCELCS drivers to create the files.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS/ACCESS Interface to PC FilesMicrosoft® Windows® for x649.49.4_M19.4 TS1M09.4 TS1M1
Microsoft Windows 8 Enterprise 32-bit9.49.4_M19.4 TS1M09.4 TS1M1
Microsoft Windows 8 Enterprise x649.49.4_M19.4 TS1M09.4 TS1M1
Microsoft Windows 8 Pro 32-bit9.49.4_M19.4 TS1M09.4 TS1M1
Microsoft Windows 8 Pro x649.49.4_M19.4 TS1M09.4 TS1M1
Microsoft Windows Server 2008 R29.49.4_M19.4 TS1M09.4 TS1M1
Microsoft Windows Server 2008 for x649.49.4_M19.4 TS1M09.4 TS1M1
Microsoft Windows Server 2012 Datacenter9.49.4_M19.4 TS1M09.4 TS1M1
Microsoft Windows Server 2012 Std9.49.4_M19.4 TS1M09.4 TS1M1
Windows 7 Enterprise x649.49.4_M19.4 TS1M09.4 TS1M1
Windows 7 Professional x649.49.4_M19.4 TS1M09.4 TS1M1
64-bit Enabled AIX9.49.4_M19.4 TS1M09.4 TS1M1
64-bit Enabled Solaris9.49.4_M19.4 TS1M09.4 TS1M1
HP-UX IPF9.49.4_M19.4 TS1M09.4 TS1M1
Linux for x649.49.4_M19.4 TS1M09.4 TS1M1
Solaris for x649.49.4_M19.4 TS1M09.4 TS1M1
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.